<?php

require_once (dirname(__FILE__)."/gallery.class.php");

$req = new galleryRequest ();
$fps = new flickrPhotoSearch ($req);
$fpi = new flickrPhotoInfo ($req, $fps);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
    <head>
        <title>Gallery - <?php echo $fpi->get ('title'); ?></title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        <meta name="description" content="<?php echo $fpi->get ('description'); ?>" />
        <meta name="keywords" content="<?php echo $fpi->get ('keywords'); ?> " />
        <meta name="robots" content="<?php echo $req->index (); ?>" />
        <link rel="stylesheet" href="gallery.css" type="text/css" />
    </head>
    <body>
<?php

if (!$fps->is_error ()) {

?>
        <div id="pThumbs">
<?php

	$pObjects = $fps->get ();
    for($i = 0; $i < MAX_PER_PAGE; $i++) {
?>
            <?php echo $req->id ($i, isset ($pObjects[$i]) ? $pObjects[$i]:NULL); ?> 
<?php

    }

?>
        </div>
        <div id="pNavi">
            <div class="lArrow"><?php echo $req->pprev (); ?></div>
            <div class="lArrow"><?php echo $req->prev (); ?></div>
            <div id="pPage">
                <?php echo STR_PAGE; ?>&nbsp;
<?php

    for ($i = 1; $i <= $fps->pages; $i++) {

?>
                <?php echo $req->page ($i); ?>&nbsp;
<?php

    }

?>
            </div>
            <div class="rArrow"><?php echo $req->next ($fps->total); ?></div>
            <div class="rArrow"><?php echo $req->pnext ($fps->pages); ?></div>
        </div>
        <div id="pBig">
            <?php echo $req->big ($fps); ?> 
        </div>
        <div id="pDescription">
            <?php echo $fpi->get ('description'); ?>&nbsp;
        </div>
        <div id="pTags">
            <strong><?php echo STR_TAGS; ?></strong><br/>
            <?php echo $req->ptag (STR_ALL); ?>&nbsp;
<?php

    $fpt = new flickrPhotoTags ();
    foreach ($fpt->get () as $tag) {

?>
            <?php echo $req->ptag ($tag, $fpi->get ('tags')); ?>&nbsp;
<?php

    }

?>
        </div>
<?php

}
else {
    print_r ($fps->error ());
}

?>
        <div id="pFooter">
            <strong>phpFlickrGallery 0.2</strong> &copy; 2007 <a href="http://lloc.de/">Dennis Pl&ouml;tner</a>
        </div>
    </body>
</html>
